<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class Perseon {
            constructor(name, age, chinese, math) {
                this.name = name;
                this.age = age;
                this.chinese = chinese;
                this.math = math;
            }
            information() {
                let arr = [];
                arr['姓名:'] = this.name;
                arr['年龄:'] = this.age;
                arr['语文:'] = this.chinese;
                arr['数学:'] = this.math;
                // arr['length'] = 4;
                return arr;
            }
        }
        class Student extends Perseon {
            constructor(name, age, chinese, math) {
                super(name, age, chinese, math);
            }
            print() {
                let arr = super.information();
                for(let key in arr){
                    console.log(key+arr[key]);
                }
            }
        }
        let stu = new Student("吕小杰", 28, "60", "80");
        stu.print();
    </script>
</body>

</html>